package com.ndp.fb.creative.fetchdata.dao.mysql.impl.mapper;

import com.ndp.fb.creative.fetchdata.dao.domain.Image;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Component;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by EVAN on 2014/10/25.
 */
@Component
public class HashCodeRowMapper implements RowMapper<Image> {
    @Override
    public Image mapRow(ResultSet rs, int rowNum) throws SQLException {
        Image o = new Image();
        o.setId(rs.getLong("id"));
        o.setImageId(rs.getString("image_id"));
        o.setName(rs.getString("name"));
        o.setHashCode(rs.getString("hash_code"));
        o.setVisitPath(rs.getString("visit_path"));
        o.setLitImgUrl(rs.getString("lit_img_url"));

        return o;
    }
}
